﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using DualityClient;
using DualityClient.Screens;
using DualityEngine.Business;

namespace DualityClient.MenuComponents.Buttons
{
    public class LoginButton : Button
    {
        public LoginButton(Texture2D controlbackground, Texture2D hovercontrolbackground, Vector2 position)
           : base(controlbackground, hovercontrolbackground, position)
        {
        }

        public override void Action()
        {
            //el_stupido
            //dribbel89
            if (PlayerManager.Instance.ValidateUser(((LoginScreen)ScreenManager.Instance.GetScreen("LoginMenu")).usernametextbox.content, ((LoginScreen)ScreenManager.Instance.GetScreen("LoginMenu")).passwordtextbox.content))
            {                
                GameState.Instance.gameState = eGameState.INGAME;
            }
            else
            {
                //TODO: Popup wanneer niet klopt
            }
        }
    }
}
